package com.song.pj.module.controller;

import com.song.pj.module.pojo.RequestParameter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class ParamObjectController {
    //doParam01？name=mvc
    @GetMapping("/doParam01")
    public String doMethodParam(String name){
        return "request params "+name;
    }
    @GetMapping("/requestparam")
    public String doRequestParam(RequestParameter param){
        return "request params "+param.toString();
    }

    @GetMapping("/doParam03")
    public String doMethodParam(@RequestParam Map<String,Object> map){
        //当方法参数是map类型，而且希望基于map接收客户端请求参数，
        return "do"+map.toString();
    }
}
